import proRequest from "@/request/product";

interface CategoryData {
    id: number,
    name: string,
    category1Id?: number,
    category2Id?: number
}
export type CategoryListData = CategoryData[]

// GET /admin/product/getCategory1
// getCategory1
export const getCategory1 = () => {
    return proRequest.get<any, CategoryListData>('/admin/product/getCategory1')
}

// GET /admin/product/getCategory2/{category1Id}
// getCategory2
export const getCategory2 = (category1Id: number) => {
    return proRequest.get<any, CategoryListData>(`/admin/product/getCategory2/${category1Id}`)
}

// GET /admin/product/getCategory3/{category2Id}
// getCategory3
export const getCategory3 = (category2Id: number) => {
    return proRequest.get<any, CategoryListData>(`/admin/product/getCategory3/${category2Id}`)
}